package com.bignerdranch.android.ecar.Activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ListView;

import com.bignerdranch.android.ecar.Adapter.WashAdapter;
import com.bignerdranch.android.ecar.Bean.RefuelBean;
import com.bignerdranch.android.ecar.Bean.WashBean;
import com.bignerdranch.android.ecar.R;

import java.util.ArrayList;
import java.util.List;

public class WashActivity extends BaseActivity implements View.OnClickListener {

    private ImageButton wash_back;
    private ListView wash_list;
    private List<WashBean> mData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wash);
        initView();
        intiData();
        wash_list.setAdapter(new WashAdapter(this,mData));
    }

    private void initView() {
        wash_back = (ImageButton) findViewById(R.id.wash_back);
        wash_list = (ListView) findViewById(R.id.wash_list);

        wash_back.setOnClickListener(this);
    }
    private void intiData(){
        mData = new ArrayList<>();
        for(int i = 0;i <10 ;i++){
            WashBean bean = new WashBean("洗车人家",(1.5+i*8)+"km","农业路东风路");
            mData.add(bean);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.wash_back:
                finish();
                break;
        }
    }
}
